//import axios from 'axios';
import axios from '../../libs/api.request'
import apiPreTool from './apiPreTool'

export default {
    getFilterGroupApi(formId) {
        return axios.request({
            url   : apiPreTool.getApiUrl('/forms/' + formId + '/filter'),
            method: 'get',
        });
        //return axios.get('/api/admin/v1/forms/' + formId + '/filter');
    },
    createFilterGroupApi({formId, info}) {
        return axios.request({
            url   : apiPreTool.getApiUrl('/forms/' + formId + '/filter'),
            method: 'post',
            data  : info,
        });
        // return axios.post('/api/admin/v1/forms/' + formId + '/filter', info);
    },
    updateFilterGroupApi({filterId, info}) {
        return axios.request({
            url   : apiPreTool.getApiUrl('/forms/filter/' + filterId),
            method: 'put',
            data  : info,
        });
        // return axios.put('/api/admin/v1/forms/filter/' + filterId, info)
    },
    deleteFilterGroupApi(filterId) {
        return axios.request({
            url   : apiPreTool.getApiUrl('/forms/filter/' + filterId),
            method: 'delete',
        });
        // return axios.delete('/api/admin/v1/forms/filter/' + filterId);
    }
}
